using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Collections;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class InitResponse : GeneratedMessageLite<InitResponse, InitResponse.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<InitResponse, InitResponse.Builder>
		{
			private bool resultIsReadOnly;
			private InitResponse result;
			protected override InitResponse.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override InitResponse MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override InitResponse DefaultInstanceForType
			{
				get
				{
					return InitResponse.DefaultInstance;
				}
			}
			public BaseResponse BaseResponse
			{
				get
				{
					return this.result.BaseResponse;
				}
				set
				{
					this.SetBaseResponse(value);
				}
			}
			public uint NewSyncKey
			{
				get
				{
					return this.result.NewSyncKey;
				}
				set
				{
					this.SetNewSyncKey(value);
				}
			}
			public int ContinueFlag
			{
				get
				{
					return this.result.ContinueFlag;
				}
				set
				{
					this.SetContinueFlag(value);
				}
			}
			public uint CmdCount
			{
				get
				{
					return this.result.CmdCount;
				}
				set
				{
					this.SetCmdCount(value);
				}
			}
			public IPopsicleList<CmdItem> CmdListList
			{
				get
				{
					return this.PrepareBuilder().cmdList_;
				}
			}
			public int CmdListCount
			{
				get
				{
					return this.result.CmdListCount;
				}
			}
			public SKBuiltinString_t Buffer
			{
				get
				{
					return this.result.Buffer;
				}
				set
				{
					this.SetBuffer(value);
				}
			}
			public uint Ratio
			{
				get
				{
					return this.result.Ratio;
				}
				set
				{
					this.SetRatio(value);
				}
			}
			public Builder()
			{
				this.result = InitResponse.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(InitResponse cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private InitResponse PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					InitResponse other = this.result;
					this.result = new InitResponse();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override InitResponse.Builder Clear()
			{
				this.result = InitResponse.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override InitResponse.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new InitResponse.Builder(this.result);
				}
				return new InitResponse.Builder().MergeFrom(this.result);
			}
			public override InitResponse BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override InitResponse.Builder MergeFrom(IMessageLite other)
			{
				if (other is InitResponse)
				{
					return this.MergeFrom((InitResponse)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override InitResponse.Builder MergeFrom(InitResponse other)
			{
				return this;
			}
			public override InitResponse.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override InitResponse.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(InitResponse._initResponseFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = InitResponse._initResponseFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 24u)
					{
						if (num3 <= 10u)
						{
							if (num3 == 0u)
							{
								throw InvalidProtocolBufferException.InvalidTag();
							}
							if (num3 == 10u)
							{
								BaseResponse.Builder builder = BaseResponse.CreateBuilder();
								if (this.result.hasBaseResponse)
								{
									builder.MergeFrom(this.BaseResponse);
								}
								input.ReadMessage(builder, extensionRegistry);
								this.BaseResponse = builder.BuildPartial();
								continue;
							}
						}
						else
						{
							if (num3 == 16u)
							{
								this.result.hasNewSyncKey = input.ReadUInt32(ref this.result.newSyncKey_);
								continue;
							}
							if (num3 == 24u)
							{
								this.result.hasContinueFlag = input.ReadInt32(ref this.result.continueFlag_);
								continue;
							}
						}
					}
					else
					{
						if (num3 <= 42u)
						{
							if (num3 == 32u)
							{
								this.result.hasCmdCount = input.ReadUInt32(ref this.result.cmdCount_);
								continue;
							}
							if (num3 == 42u)
							{
								input.ReadMessageArray<CmdItem>(num, text, this.result.cmdList_, CmdItem.DefaultInstance, extensionRegistry);
								continue;
							}
						}
						else
						{
							if (num3 == 50u)
							{
								SKBuiltinString_t.Builder builder2 = SKBuiltinString_t.CreateBuilder();
								if (this.result.hasBuffer)
								{
									builder2.MergeFrom(this.Buffer);
								}
								input.ReadMessage(builder2, extensionRegistry);
								this.Buffer = builder2.BuildPartial();
								continue;
							}
							if (num3 == 56u)
							{
								this.result.hasRatio = input.ReadUInt32(ref this.result.ratio_);
								continue;
							}
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public InitResponse.Builder SetBaseResponse(BaseResponse value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasBaseResponse = true;
				this.result.baseResponse_ = value;
				return this;
			}
			public InitResponse.Builder SetBaseResponse(BaseResponse.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasBaseResponse = true;
				this.result.baseResponse_ = builderForValue.Build();
				return this;
			}
			public InitResponse.Builder MergeBaseResponse(BaseResponse value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasBaseResponse && this.result.baseResponse_ != BaseResponse.DefaultInstance)
				{
					this.result.baseResponse_ = BaseResponse.CreateBuilder(this.result.baseResponse_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.baseResponse_ = value;
				}
				this.result.hasBaseResponse = true;
				return this;
			}
			public InitResponse.Builder ClearBaseResponse()
			{
				this.PrepareBuilder();
				this.result.hasBaseResponse = false;
				this.result.baseResponse_ = null;
				return this;
			}
			public InitResponse.Builder SetNewSyncKey(uint value)
			{
				this.PrepareBuilder();
				this.result.hasNewSyncKey = true;
				this.result.newSyncKey_ = value;
				return this;
			}
			public InitResponse.Builder ClearNewSyncKey()
			{
				this.PrepareBuilder();
				this.result.hasNewSyncKey = false;
				this.result.newSyncKey_ = 0u;
				return this;
			}
			public InitResponse.Builder SetContinueFlag(int value)
			{
				this.PrepareBuilder();
				this.result.hasContinueFlag = true;
				this.result.continueFlag_ = value;
				return this;
			}
			public InitResponse.Builder ClearContinueFlag()
			{
				this.PrepareBuilder();
				this.result.hasContinueFlag = false;
				this.result.continueFlag_ = 0;
				return this;
			}
			public InitResponse.Builder SetCmdCount(uint value)
			{
				this.PrepareBuilder();
				this.result.hasCmdCount = true;
				this.result.cmdCount_ = value;
				return this;
			}
			public InitResponse.Builder ClearCmdCount()
			{
				this.PrepareBuilder();
				this.result.hasCmdCount = false;
				this.result.cmdCount_ = 0u;
				return this;
			}
			public CmdItem GetCmdList(int index)
			{
				return this.result.GetCmdList(index);
			}
			public InitResponse.Builder SetCmdList(int index, CmdItem value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.cmdList_[index] = value;
				return this;
			}
			public InitResponse.Builder SetCmdList(int index, CmdItem.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.cmdList_[index] = builderForValue.Build();
				return this;
			}
			public InitResponse.Builder AddCmdList(CmdItem value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.cmdList_.Add(value);
				return this;
			}
			public InitResponse.Builder AddCmdList(CmdItem.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.cmdList_.Add(builderForValue.Build());
				return this;
			}
			public InitResponse.Builder AddRangeCmdList(IEnumerable<CmdItem> values)
			{
				this.PrepareBuilder();
				this.result.cmdList_.Add(values);
				return this;
			}
			public InitResponse.Builder ClearCmdList()
			{
				this.PrepareBuilder();
				this.result.cmdList_.Clear();
				return this;
			}
			public InitResponse.Builder SetBuffer(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasBuffer = true;
				this.result.buffer_ = value;
				return this;
			}
			public InitResponse.Builder SetBuffer(SKBuiltinString_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasBuffer = true;
				this.result.buffer_ = builderForValue.Build();
				return this;
			}
			public InitResponse.Builder MergeBuffer(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasBuffer && this.result.buffer_ != SKBuiltinString_t.DefaultInstance)
				{
					this.result.buffer_ = SKBuiltinString_t.CreateBuilder(this.result.buffer_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.buffer_ = value;
				}
				this.result.hasBuffer = true;
				return this;
			}
			public InitResponse.Builder ClearBuffer()
			{
				this.PrepareBuilder();
				this.result.hasBuffer = false;
				this.result.buffer_ = null;
				return this;
			}
			public InitResponse.Builder SetRatio(uint value)
			{
				this.PrepareBuilder();
				this.result.hasRatio = true;
				this.result.ratio_ = value;
				return this;
			}
			public InitResponse.Builder ClearRatio()
			{
				this.PrepareBuilder();
				this.result.hasRatio = false;
				this.result.ratio_ = 0u;
				return this;
			}
		}
		public const int BaseResponseFieldNumber = 1;
		public const int NewSyncKeyFieldNumber = 2;
		public const int ContinueFlagFieldNumber = 3;
		public const int CmdCountFieldNumber = 4;
		public const int CmdListFieldNumber = 5;
		public const int BufferFieldNumber = 6;
		public const int RatioFieldNumber = 7;
		private static readonly InitResponse defaultInstance;
		private static readonly string[] _initResponseFieldNames;
		private static readonly uint[] _initResponseFieldTags;
		private bool hasBaseResponse;
		private BaseResponse baseResponse_;
		private bool hasNewSyncKey;
		private uint newSyncKey_;
		private bool hasContinueFlag;
		private int continueFlag_;
		private bool hasCmdCount;
		private uint cmdCount_;
		private PopsicleList<CmdItem> cmdList_ = new PopsicleList<CmdItem>();
		private bool hasBuffer;
		private SKBuiltinString_t buffer_;
		private bool hasRatio;
		private uint ratio_;
		private int memoizedSerializedSize = -1;
		public static InitResponse DefaultInstance
		{
			get
			{
				return InitResponse.defaultInstance;
			}
		}
		public override InitResponse DefaultInstanceForType
		{
			get
			{
				return InitResponse.DefaultInstance;
			}
		}
		protected override InitResponse ThisMessage
		{
			get
			{
				return this;
			}
		}
		public BaseResponse BaseResponse
		{
			get
			{
				return this.baseResponse_ ?? BaseResponse.DefaultInstance;
			}
		}
		public uint NewSyncKey
		{
			get
			{
				return this.newSyncKey_;
			}
		}
		public int ContinueFlag
		{
			get
			{
				return this.continueFlag_;
			}
		}
		public uint CmdCount
		{
			get
			{
				return this.cmdCount_;
			}
		}
		public IList<CmdItem> CmdListList
		{
			get
			{
				return this.cmdList_;
			}
		}
		public int CmdListCount
		{
			get
			{
				return this.cmdList_.Count;
			}
		}
		public SKBuiltinString_t Buffer
		{
			get
			{
				return this.buffer_ ?? SKBuiltinString_t.DefaultInstance;
			}
		}
		public uint Ratio
		{
			get
			{
				return this.ratio_;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				if (!this.hasBaseResponse)
				{
					return false;
				}
				if (!this.hasNewSyncKey)
				{
					return false;
				}
				if (!this.hasContinueFlag)
				{
					return false;
				}
				if (!this.hasCmdCount)
				{
					return false;
				}
				if (!this.hasBuffer)
				{
					return false;
				}
				if (!this.hasRatio)
				{
					return false;
				}
				if (!this.BaseResponse.IsInitialized)
				{
					return false;
				}
				bool result;
				using (IEnumerator<CmdItem> enumerator = this.CmdListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						CmdItem current = enumerator.get_Current();
						if (!current.IsInitialized)
						{
							result = false;
							return result;
						}
					}
					return true;
				}
				return result;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasBaseResponse)
				{
					num += CodedOutputStream.ComputeMessageSize(1, this.BaseResponse);
				}
				if (this.hasNewSyncKey)
				{
					num += CodedOutputStream.ComputeUInt32Size(2, this.NewSyncKey);
				}
				if (this.hasContinueFlag)
				{
					num += CodedOutputStream.ComputeInt32Size(3, this.ContinueFlag);
				}
				if (this.hasCmdCount)
				{
					num += CodedOutputStream.ComputeUInt32Size(4, this.CmdCount);
				}
				using (IEnumerator<CmdItem> enumerator = this.CmdListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						CmdItem current = enumerator.get_Current();
						num += CodedOutputStream.ComputeMessageSize(5, current);
					}
				}
				if (this.hasBuffer)
				{
					num += CodedOutputStream.ComputeMessageSize(6, this.Buffer);
				}
				if (this.hasRatio)
				{
					num += CodedOutputStream.ComputeUInt32Size(7, this.Ratio);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private InitResponse()
		{
		}
		public CmdItem GetCmdList(int index)
		{
			return this.cmdList_[index];
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] initResponseFieldNames = InitResponse._initResponseFieldNames;
			if (this.hasBaseResponse)
			{
				output.WriteMessage(1, initResponseFieldNames[0], this.BaseResponse);
			}
			if (this.hasNewSyncKey)
			{
				output.WriteUInt32(2, initResponseFieldNames[5], this.NewSyncKey);
			}
			if (this.hasContinueFlag)
			{
				output.WriteInt32(3, initResponseFieldNames[4], this.ContinueFlag);
			}
			if (this.hasCmdCount)
			{
				output.WriteUInt32(4, initResponseFieldNames[2], this.CmdCount);
			}
			if (this.cmdList_.Count > 0)
			{
				output.WriteMessageArray<CmdItem>(5, initResponseFieldNames[3], this.cmdList_);
			}
			if (this.hasBuffer)
			{
				output.WriteMessage(6, initResponseFieldNames[1], this.Buffer);
			}
			if (this.hasRatio)
			{
				output.WriteUInt32(7, initResponseFieldNames[6], this.Ratio);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasBaseResponse)
			{
				num ^= this.baseResponse_.GetHashCode();
			}
			if (this.hasNewSyncKey)
			{
				num ^= this.newSyncKey_.GetHashCode();
			}
			if (this.hasContinueFlag)
			{
				num ^= this.continueFlag_.GetHashCode();
			}
			if (this.hasCmdCount)
			{
				num ^= this.cmdCount_.GetHashCode();
			}
			using (IEnumerator<CmdItem> enumerator = this.cmdList_.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					CmdItem current = enumerator.get_Current();
					num ^= current.GetHashCode();
				}
			}
			if (this.hasBuffer)
			{
				num ^= this.buffer_.GetHashCode();
			}
			if (this.hasRatio)
			{
				num ^= this.ratio_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			InitResponse initResponse = object_0 as InitResponse;
			if (initResponse == null)
			{
				return false;
			}
			if (this.hasBaseResponse != initResponse.hasBaseResponse || (this.hasBaseResponse && !this.baseResponse_.Equals(initResponse.baseResponse_)))
			{
				return false;
			}
			if (this.hasNewSyncKey != initResponse.hasNewSyncKey || (this.hasNewSyncKey && !this.newSyncKey_.Equals(initResponse.newSyncKey_)))
			{
				return false;
			}
			if (this.hasContinueFlag != initResponse.hasContinueFlag || (this.hasContinueFlag && !this.continueFlag_.Equals(initResponse.continueFlag_)))
			{
				return false;
			}
			if (this.hasCmdCount != initResponse.hasCmdCount || (this.hasCmdCount && !this.cmdCount_.Equals(initResponse.cmdCount_)))
			{
				return false;
			}
			if (this.cmdList_.Count != initResponse.cmdList_.Count)
			{
				return false;
			}
			for (int i = 0; i < this.cmdList_.Count; i++)
			{
				if (!this.cmdList_[i].Equals(initResponse.cmdList_[i]))
				{
					return false;
				}
			}
			return this.hasBuffer == initResponse.hasBuffer && (!this.hasBuffer || this.buffer_.Equals(initResponse.buffer_)) && (this.hasRatio == initResponse.hasRatio && (!this.hasRatio || this.ratio_.Equals(initResponse.ratio_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField("BaseResponse", this.hasBaseResponse, this.baseResponse_, writer);
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField("NewSyncKey", this.hasNewSyncKey, this.newSyncKey_, writer);
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField("ContinueFlag", this.hasContinueFlag, this.continueFlag_, writer);
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField("CmdCount", this.hasCmdCount, this.cmdCount_, writer);
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField<CmdItem>("CmdList", this.cmdList_, writer);
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField("Buffer", this.hasBuffer, this.buffer_, writer);
			GeneratedMessageLite<InitResponse, InitResponse.Builder>.PrintField("Ratio", this.hasRatio, this.ratio_, writer);
		}
		public static InitResponse ParseFrom(byte[] data)
		{
			return InitResponse.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private InitResponse MakeReadOnly()
		{
			this.cmdList_.MakeReadOnly();
			return this;
		}
		public static InitResponse.Builder CreateBuilder()
		{
			return new InitResponse.Builder();
		}
		public override InitResponse.Builder ToBuilder()
		{
			return InitResponse.CreateBuilder(this);
		}
		public override InitResponse.Builder CreateBuilderForType()
		{
			return new InitResponse.Builder();
		}
		public static InitResponse.Builder CreateBuilder(InitResponse prototype)
		{
			return new InitResponse.Builder(prototype);
		}
		static InitResponse()
		{
			InitResponse.defaultInstance = new InitResponse().MakeReadOnly();
			InitResponse._initResponseFieldNames = new string[]
			{
				"BaseResponse",
				"Buffer",
				"CmdCount",
				"CmdList",
				"ContinueFlag",
				"NewSyncKey",
				"Ratio"
			};
			InitResponse._initResponseFieldTags = new uint[]
			{
				10u,
				50u,
				32u,
				42u,
				24u,
				16u,
				56u
			};
			object.ReferenceEquals(micromsg.Proto.InitResponse.Descriptor, null);
		}
	}
}
